package com.zhuoyue.biz.core.api.dto.req;

import com.zhuoyue.common.group.ValidationGroups;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author wjming
 * @ClassName: LoginReqDTO
 * @Description: 用户登陆对象信息
 * @Date 2021-06-28 11:22
 * 注意: ValidationGroups.Insert.class这是一个分组验证配置
 */
@Data
public class UserReqDTO {
    /**
     * 用户账号
     */
    @Pattern(regexp = "^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$", groups = {ValidationGroups.Insert.class})
    private String account;
    /**
     * 用户密码
     */
    @Size(min = 6, max = 20, message = "密码最少6位,密码最长20位", groups = {ValidationGroups.Insert.class})
    private String password;
    /**
     * 手机的推送码用于推送 （极光推送ID）
     */
    @NotBlank(message = "推送ID不能为空", groups = {ValidationGroups.Insert.class})
    private String sourceId;
    /**
     * 快速登陆开放ID
     */
    @Size(max = 100, message = "长度最大100", groups = {ValidationGroups.Insert.class})
    private String openId;
    /**
     * 快速登录类型(快速登陆类型(目前支持苹果、QQ、微信))
     */
    @Size(max = 1, message = "最长1", groups = {ValidationGroups.Insert.class})
    private String type;
    /**
     * 推送类型 (推送的手机类型)，安卓或者苹果
     */
    @Size(max = 1, message = "最长1", groups = {ValidationGroups.Insert.class})
    private String sourceType;

    /**
     * 昵称
     */
    @Size(max = 15, message = "昵称长度最大15", groups = {ValidationGroups.Update.class})
    private String nickName;

    /**
     * 图片
     */
    @Size(max = 200, message = "图片地址最大为200", groups = {ValidationGroups.Update.class})
    private String imgUrl;
}
